#include "my_inc/main_login.h"

char *time_get()
{
    time_t res       = time(NULL);      // 取当前时间戳
    struct tm * loct = localtime(&res); // 取当前时间的结构体(已转换)
    // 作用：取得当地目前时间和日期，此函数返回的时间日期己经转换成当地时区
    char * t_g = malloc(40);
    sprintf(t_g, "%d-%02d-%02d  %d:%d:%02d\0", (1900 + loct->tm_year), (1 + loct->tm_mon), (loct->tm_mday),
            (loct->tm_hour), (loct->tm_min), (loct->tm_sec));
    return t_g;
}